home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
cmln0785.arc
/
EXOTIC.LTG
< prev
next >
Wrap
Text File
|
1986-02-27
|
2KB
|
64 lines
Exotic Language of the Month -- July 1985
MRS Language
Listing 1
(assert '(template (&x &y) (&y is &x)))
(assert '(template (hobbit &y) (&y is a hobbit)))
(assert '(template (orc &y) (&y is a orc)))
(assert '(template (age &x &y) (&x is &y years old)))
(defun find (x) (output (plug x (truep x))))
Listing 2
(assert '(if (ugly $x) (nasty $x ugly)))
(assert '(if (mean $x) (nasty $x mean)))
(assert '(template (nasty &x &y)(&x is nasty because he is &y)
(setq preferred t)
(assert '(preferred (bcdisp ((ugly &x)).l)
(bcdisp ((mean &y)). &m)))
(find '(nasty $x $y))
ragashaδ i≤ nast∙ becausσ hσ i≤ ugly
Listing 3
(goal-state {statedescription})
(illegal-state {statedescription})
(possible-operator operator-n {statedescription} {newstatedescription} )
(if (or (goal-state {statedescription})
(and (unprovable (illegal-state {statedescription}))
(possible-operator $operator {statedes} {newstatedes} )
(hobbits-orcs $ops {newstatedes})))
(hobbits-orcs ($operator . $ops) {statedescription} ))
Listing 4
(onside state-0 north orcs ragashak)
(onside state-0 north numberoforcs 2)
(onside state-0 south numberoforcs 0)
(onside state-0 north hobbits Bilbo)....
(if (and (onside $state south numberoforcs 2)
(onside $state south numberofhobbits 2))
(goal $state))
(if (and (onside $state $anyside numberoforcs $norcs)
(onside $state $anyside numberofhobbits $nhobbits)
(> $norcs $nhobbits))
(illegal-state $state))
è Listing 5
(tolookup (onside &state &side &type &value) strips)
(defun strips
(state side type value)
(or (lookup `(onside-g ,state ,side ,type ,value))
(strips (lookupbdg '$nextstate `($nextstate ,state '$nextstate))
side type value)))